@import "variables";
@import "mixins";
@import "layout";

#search-results {
  position: absolute;
  top: 2px;
  right: -8px;
  z-index: 900;
  display: none;
  width: 384px;
  background: #398a94 url($baseurl + "images/bg/search-header.jpg") 0 1px repeat-x;
  @include border-radius(3px);
  @include box-shadow(0 0 7px rgba(0, 0, 0, 0.25));
  border-bottom: solid 1px $base-border-color;

  header {
    height: 44px;
    padding: 0;
    margin: 0;
    text-indent: -9999px;
    border: solid 1px #366769;
    @include border-top-right-radius(3px);
    @include border-top-left-radius(3px);
  }

  table {
    width: 100%;
    line-height: 1;
    background-color: #fff;
    @include border-bottom-right-radius(3px);
    @include border-bottom-left-radius(3px);

    td {
      border-top: solid 1px #cfddde;
    }

    td.category {
      width: 67px;
      padding: 10px 12px 0 0;
      font-size: 11px;
      color: $blue;
      text-align: right;
      vertical-align: top;
      background-color: #f5fbfb;
      border-right: solid 1px #cfddde;
      opacity: 0.75;
    }

    td.matches {
      padding: 0 !important;
      font-size: 12px;

      a {
        display: block;
        padding: 5px 12px;
        margin-bottom: 0;
        font-weight: bold;
        color: $font-color;
        transition-duration: 0s;

        &:hover,
        &.highlight {
          color: #fff;
          text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
          background: #55bec4;
          background-image: linear-gradient(#55bec4, #54b2b7);

          span {
            color: #fff;
          }
        }
      }
    }

    ul {
      @extend .unstyled !optional;
      margin-bottom: 0;
    }

    tr.show-all td {
      border-top: none;
    }
  }
}

ol.full-search-results {
  @extend .unstyled !optional;

  li {
    margin-bottom: 2em;

    &:last-child {
      margin-bottom: 0;
    }
  }

  h3 {
    line-height: 1.4;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  span.relevancy {
    float: right;
    padding-left: 5px;
    margin-left: 30px;

    img {
      position: relative;
      top: -2px;
    }
  }

  a.url {
    display: block;
    margin-bottom: 0.4em;
    font-size: 12px;
    color: $light-font-color;

    &:hover {
      color: darken($light-font-color, 25%);
    }
  }
}

.callout.top-matches {
  padding-top: 1em !important;
  margin-bottom: 2em !important;
}

// Breakpoint ---
@media (max-width: $default) {
  #search-results{
    @include center-transformX;
    top: unset;
    width: 98%;
  }
}
// Mobile
@media (max-width: $mobile-m) {
  #search-results{
    margin-top: 4px;
  }
}

// Search results page
#search-div {
  border: solid 1px $base-border-color;
  background: $main-bg;
  padding: 22px;
  @include border-radius(5px);

  ol {
    background-color: $callout-color;
    @include border-radius(3px);
    padding: 8px 14px 4px;
    margin: 0 0 1.4em;
    list-style: none;
  }


  .pagefind-ui__result-inner > .pagefind-ui__result-title {
    font-size: 16px;
    line-height: $base-line-height * 2;
    font-weight: bold;
  }

  .pagefind-ui__result-tags {
    list-style: none;
    color: $light-font-color;
    margin-bottom: 1.4em;
    margin-left: 0;
  }
}

button {
  border-color: $link-color;
  color: $link-color;
  background: $callout-color;
  font-weight: bold;
  @include border-radius(3px);
  outline: none;
  padding: 0 0.5em;
}
